package bg.btanev.eightyfour.repository;

import java.util.List;

import bg.btanev.eightyfour.domain.experience.EducationExperience;
import bg.btanev.eightyfour.domain.experience.ExperiencePeriod;
import bg.btanev.eightyfour.domain.experience.WorkExperience;
import bg.btanev.eightyfour.domain.experience.institution.EducationInstitution;
import bg.btanev.eightyfour.domain.experience.institution.WorkInstitution;
import bg.btanev.eightyfour.domain.person.ContactInfo;
import bg.btanev.eightyfour.domain.person.Person;
import bg.btanev.eightyfour.domain.person.PersonName;

/**
 *
 * @author B.Tanev
 *
 */
public interface PersonRepository {
	Person createAndStorePerson(PersonName personName, ContactInfo contactInfo);

	void storePerson(Person person);

	void removePerson(Person person);

	WorkExperience createWorkExperience(ExperiencePeriod period, WorkInstitution institution, Person person,
			String position);

	EducationExperience createEducationExperience(ExperiencePeriod period, EducationInstitution institution,
			Person person, String speciality);

	List<Person> findAllPersons();

	Person findByEmail(String email);

	/**
	 * Search the repository for a person name. Performs case insensitive search.
	 *
	 * @param name
	 *            the {@link PersonName} to search for
	 * @return a {@link List} of {@link Person}s
	 */
	List<Person> findByExactName(PersonName name);

	/**
	 * Search the repository for a person name pattern. Performs case insensitive search with match mode anywhere.
	 *
	 * @param name
	 *            the {@link PersonName} to search for
	 * @return a {@link List} of {@link Person}s
	 */
	List<Person> findByName(PersonName name);

	Person findByIdentifier(Long personId);
}
